package com.frain.springcloud.util;

import java.io.Serializable;

/**
 * 
 * @ClassName: HttpRequestObject 
 * @Description: 发送http请求参数封装 
 * @author frain
 * @date 2018年8月15日 上午11:37:17 
 *
 */
public class HttpRequestObject implements Serializable {
    /** 
     * @Fields serialVersionUID : 
     */
    private static final long serialVersionUID = -7332557285429147713L;

    // http请求路径
    private String url;

    // 请求参数String
    private String paramObject;

    // 请求类型 get / post
    private String requestType = "GET";

    // 请求加密方式
    private String requestEncode = "UTF-8";

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getParamObject() {
        return paramObject;
    }

    public void setParamObject(String paramObject) {
        this.paramObject = paramObject;
    }

    public String getRequestType() {
        return requestType;
    }

    public void setRequestType(String requestType) {
        this.requestType = requestType;
    }

    public String getRequestEncode() {
        return requestEncode;
    }

    public void setRequestEncode(String requestEncode) {
        this.requestEncode = requestEncode;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((paramObject == null) ? 0 : paramObject.hashCode());
        result = prime * result + ((requestEncode == null) ? 0 : requestEncode.hashCode());
        result = prime * result + ((requestType == null) ? 0 : requestType.hashCode());
        result = prime * result + ((url == null) ? 0 : url.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        HttpRequestObject other = (HttpRequestObject) obj;
        if (paramObject == null) {
            if (other.paramObject != null) return false;
        } else if (!paramObject.equals(other.paramObject)) return false;
        if (requestEncode == null) {
            if (other.requestEncode != null) return false;
        } else if (!requestEncode.equals(other.requestEncode)) return false;
        if (requestType == null) {
            if (other.requestType != null) return false;
        } else if (!requestType.equals(other.requestType)) return false;
        if (url == null) {
            if (other.url != null) return false;
        } else if (!url.equals(other.url)) return false;
        return true;
    }

    @Override
    public String toString() {
        return "HttpRequestObject [url=" + url + ", paramObject=" + paramObject + ", requestType=" + requestType
                + ", requestEncode=" + requestEncode + "]";
    }

}
